from django.shortcuts import render
from rest_framework.generics import ListCreateAPIView, RetrieveUpdateDestroyAPIView
from .models import Kind, Menu
from .models import ImageList as Imagemodel
from .serializers import KindSerializer, ImageSerializer, MenuSerializer

# Create your views here.


class KindList(ListCreateAPIView):
    queryset = Kind.objects.order_by('index', 'updated_time', 'created_time').all()
    serializer_class = KindSerializer


class KindDetail(RetrieveUpdateDestroyAPIView):
    queryset = Kind.objects.order_by('index', 'updated_time', 'created_time').all()
    serializer_class = KindSerializer


class ImageList(ListCreateAPIView):
    queryset = Imagemodel.objects.order_by('index', 'updated_time', 'created_time').all()
    serializer_class = ImageSerializer


class ImageDetail(RetrieveUpdateDestroyAPIView):
    queryset = Imagemodel.objects.order_by('index', 'updated_time', 'created_time').all()
    serializer_class = ImageSerializer


class MenuList(ListCreateAPIView):
    queryset = Menu.objects.order_by('index', 'updated_time', 'created_time').all()
    serializer_class = MenuSerializer


class MenuDetail(RetrieveUpdateDestroyAPIView):
    queryset = Menu.objects.order_by('index', 'updated_time', 'created_time').all()
    serializer_class = MenuSerializer
